package com.zk.shop.entity;

import com.alibaba.fastjson.annotation.JSONField;

import java.io.Serializable;
import java.util.Date;

/**
 * 订单类
 */
public class Order implements Serializable {
    private int orderId;    //订单id
    private String  orderNum;   //订单编号
    private User buyer;     //买家
    private User seller;    //卖家
    private Goods goods;    //商品
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    private Date orderTime; //订单时间
    private double totalPrice;//总价
    private int sellNum;
    private int state;      //订单状态  0未完成 1已完成

    public Order() {
    }

    public Order(User buyer) {
        this.buyer = buyer;
    }

    public Order(String orderNum, User buyer, User seller, Goods goods, double totalPrice, int sellNum) {
        this.orderNum = orderNum;
        this.buyer = buyer;
        this.seller = seller;
        this.goods = goods;
        this.totalPrice = totalPrice;
        this.sellNum = sellNum;
    }

    public Order(String orderNum, User buyer, int state) {
        this.orderNum = orderNum;
        this.buyer = buyer;
        this.state = state;
    }

    public String getOrderNum() {
        return orderNum;
    }

    public void setOrderNum(String orderNum) {
        this.orderNum = orderNum;
    }

    public Order(int orderId, String orderNum, User buyer, User seller, Goods goods, Date orderTime, double totalPrice, int sellNum, int state) {
        this.orderId = orderId;
        this.orderNum = orderNum;
        this.buyer = buyer;
        this.seller = seller;
        this.goods = goods;
        this.orderTime = orderTime;
        this.totalPrice = totalPrice;
        this.sellNum = sellNum;
        this.state = state;
    }

    public Order(int orderId, User buyer, User seller, Goods goods, double totalPrice, int sellNum) {
        this.orderId = orderId;
        this.buyer = buyer;
        this.seller = seller;
        this.goods = goods;
        this.totalPrice = totalPrice;
        this.sellNum = sellNum;
    }

    public int getSellNum() {
        return sellNum;
    }

    public Order(User buyer, Goods goods) {
        this.buyer = buyer;
        this.goods = goods;
    }

    public Order(int orderId, User buyer) {
        this.orderId = orderId;
        this.buyer = buyer;
    }

    public Order(User buyer, int state) {
        this.buyer = buyer;
        this.state = state;
    }

    public Order(int orderId) {
        this.orderId = orderId;
    }

    public Order(User buyer, User seller, Goods goods, double totalPrice, int sellNum) {
        this.buyer = buyer;
        this.seller = seller;
        this.goods = goods;
        this.totalPrice = totalPrice;
        this.sellNum = sellNum;
    }

    public void setSellNum(int sellNum) {
        this.sellNum = sellNum;
    }

    public Order(int orderId, User buyer, User seller, Goods goods, Date orderTime, double totalPrice, int sellNum, int state) {
        this.orderId = orderId;
        this.buyer = buyer;
        this.seller = seller;
        this.goods = goods;
        this.orderTime = orderTime;
        this.totalPrice = totalPrice;
        this.sellNum = sellNum;
        this.state = state;
    }

    public Order(User buyer, User seller, Goods goods, Date orderTime, double totalPrice, int sellNum, int state) {
        this.buyer = buyer;
        this.seller = seller;
        this.goods = goods;
        this.orderTime = orderTime;
        this.totalPrice = totalPrice;
        this.sellNum = sellNum;
        this.state = state;
    }

    public Order(User buyer, User seller, Goods goods, Date orderTime, double totalPrice, int state) {
        this.buyer = buyer;
        this.seller = seller;
        this.goods = goods;
        this.orderTime = orderTime;
        this.totalPrice = totalPrice;
        this.state = state;
    }

    public double getTotalPrice() {
        return totalPrice;
    }

    public void setTotalPrice(double totalPrice) {
        this.totalPrice = totalPrice;
    }

    public int getState() {
        return state;
    }

    public void setState(int state) {
        this.state = state;
    }

    public Order(int orderId, User buyer, User seller, Goods goods, Date orderTime, double totalPrice, int state) {
        this.orderId = orderId;
        this.buyer = buyer;
        this.seller = seller;
        this.goods = goods;
        this.orderTime = orderTime;
        this.totalPrice = totalPrice;
        this.state = state;
    }

    public Order(int orderId, User buyer, User seller, Goods goods, Date orderTime) {
        this.orderId = orderId;
        this.buyer = buyer;
        this.seller = seller;
        this.goods = goods;
        this.orderTime = orderTime;
    }

    public Order(int orderId, User buyer, User seller, Goods goods, Date orderTime, int state) {
        this.orderId = orderId;
        this.buyer = buyer;
        this.seller = seller;
        this.goods = goods;
        this.orderTime = orderTime;
        this.state = state;
    }

    public Order(int orderId, Goods goods, Date orderTime, double totalPrice, int sellNum) {
        this.orderId = orderId;
        this.goods = goods;
        this.orderTime = orderTime;
        this.totalPrice = totalPrice;
        this.sellNum = sellNum;
    }

    public Order(int orderId, User buyer, User seller, Goods goods, double totalPrice, int sellNum, int state) {
        this.orderId = orderId;
        this.buyer = buyer;
        this.seller = seller;
        this.goods = goods;
        this.totalPrice = totalPrice;
        this.sellNum = sellNum;
        this.state = state;
    }

    public int getOrderId() {
        return orderId;
    }

    public void setOrderId(int orderId) {
        this.orderId = orderId;
    }

    public User getBuyer() {
        return buyer;
    }

    public void setBuyer(User buyer) {
        this.buyer = buyer;
    }

    public User getSeller() {
        return seller;
    }

    public void setSeller(User seller) {
        this.seller = seller;
    }

    public Goods getGoods() {
        return goods;
    }

    public void setGoods(Goods goods) {
        this.goods = goods;
    }

    public Date getOrderTime() {
        return orderTime;
    }

    public void setOrderTime(Date orderTime) {
        this.orderTime = orderTime;
    }
}
